﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class ProjectDocument_Map : ClassMapping<ProjectDocument>
    {
        public ProjectDocument_Map()
        {
            //映射ID
            Id(x => x.doc_id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            Property(x => x.bgn_date);
            Property(x => x.doc_bmf);
            Property(x => x.doc_name, map => map.Length(200));
            Property(x => x.doc_price);
            Property(x => x.doc_qt);
            Property(x => x.doc_qt_describe, map => map.Length(100000));
            Property(x => x.doc_tzyj);
            Property(x => x.end_date);
            
            //标书所属项目
            ManyToOne(x => x.project, map =>
            {
                map.Column("proj_id");
            });

            Table("t_document_end");

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
